#ifndef APP_PLAYER_H
#define APP_PLAYER_H

#include <QDialog>
#include <QFileDialog>
#include <QProcess> //使用后台进程
#include <QTimer>
#include "mylabel.h"

namespace Ui {
class app_player;
}

class app_player : public QDialog
{
    Q_OBJECT

public:
    explicit app_player(QWidget *parent = 0);
    ~app_player();

    void Init();
    void playMovie(const QString filename);

private slots:

    void deal_key();

    void on_play_Button_clicked();

    void on_open_file_Button_clicked();

    void on_Button_previou_clicked();

    void on_next_Button_clicked();

    void on_seek_Slider_valueChanged(int value);

    void doProcessTimeOut();

    void doProcessreadyRead();

    void doProcessDragPlay(const QString filename); //处理拖拽播放功能

    void doProcessFullwin(bool ret); //处理全屏播放功能

    void on_voice_Slider_valueChanged(int value);

    void on_set_silence_Button_clicked();

    void on_pushButton_clicked();

    void on_seek_Slider_rangeChanged(int min, int max);

    void on_seek_Slider_sliderReleased();

    void on_seek_Slider_sliderMoved(int position);

    void on_seek_Slider_sliderPressed();

private:
    Ui::app_player *ui;
    QStringList playList;
    int play_index;
    QProcess *playProces;
    int isPlaying;  //判断暂停还是播放  0:undefine 1:playing 2:stop  4:end
    QTimer *myTimer;
    myLabel *lal;

    QStringList array;

    bool isSilence; //禁音标志位
    bool isfull;

    QTimer *KbdScanTimer;//按键扫描定时器

    char KbdStatus=0;//获取按键状态
    int Last_key_value;  //按一次只触发一次
    int key_count; //处理按键的长按短按

};

#endif // APP_PLAYER_H
